package com.linwancun.lwcyback.service;

import com.linwancun.lwcyback.mapper.PatientMapper;
import com.linwancun.lwcyback.model.Patient;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PatientServiceImp implements PatientService {
    @Resource
    PatientMapper patientMapper;

    @Override
    public void insert(Patient object) {
        patientMapper.insert(object);
    }

    @Override
    public void save(Patient object) {
        patientMapper.updateByPrimaryKey(object);
    }

    @Override
    public List<Patient> getAll() {
        return patientMapper.list(new Patient());
    }

    @Override
    public Patient find(Patient object) {
        return patientMapper.find(object);
    }

    @Override
    public void delete(Patient object) {
        patientMapper.deleteByPrimaryKey(object.getPatientid());
    }

    @Override
    public List<Patient> getList(Patient object) {
        return patientMapper.list(object);
    }
}
